package com.yb.auth.core.util;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * Copyright (C), 2022-2022, 姚兵
 * Author: 32210
 * Date: 2022/12/6 8:43
 * FileName: SecurityUtils
 * Description:
 */
public class SecurityUtils {

    public static final Authentication getAuthentication(){
        return SecurityContextHolder.getContext().getAuthentication();
    }

    public static final void setAuthentication(Authentication authentication){
        SecurityContextHolder.getContext().setAuthentication(authentication);
    }
}
